<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <title>问卷调查系统</title>
    <meta name="viewport"
        content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">

    <meta name="apple-mobile-web-app-capable" content="yes">

    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <meta name="format-detection" content="telephone=no">


</head>

<body>
    <div class="login" style="text-align: center; margin-top: 215px; " >
        <h1>问卷调查系统登录页面</h1>
        <div class="text">
            <i class="fa fa-user-o" aria-hidden="false" ></i>
            <input type="text" placeholder="账号" id="name" style="width:auto;height: auto; margin-top: 10px;">
        </div>
        <div class="text">
            <i class="fa fa-lock" aria-hidden="false"></i>
            <input type="password" placeholder="密码" id="pass" style="width:auto;height: auto;margin-top: 10px;">
        </div>
        <button onclick="login()" style="margin-top: 35px; width: 100px;;height: 30px;">登录</button>
    </div>

    <script type="text/javascript">
        function login() {
            let username = document.getElementById("name").value;
            let password = document.getElementById("pass").value;
           
           
            if (username == "admin" && password == "123") {
                alert("管理员登录成功");
                window.location = "html/listadmin.html";
                return false;
            
            }
            else if (username == "a" && password == "123") {
                alert("用户a登录成功");
                window.location = "html/listuser.html";
                return false;
            }
            else {
                alert("账号或密码错误");
                window.location = "./main.html";
                return false;
            }
        }
    </script>

</body>

</html>